package com.fox.imagedb.gui.menu.item;

import javax.swing.JFileChooser;
import javax.swing.filechooser.FileNameExtensionFilter;

import com.fox.imagedb.gui.MainPanel;

public class SaveAsMenuItem extends ImageDBMenuItem {

    private static final long serialVersionUID = -2497568052896894923L;

    public SaveAsMenuItem(MainPanel mainPanel) {
	super(mainPanel);
	setText("Sauvegarder sous...");
    }

    @Override
    public void performAction() {
	JFileChooser chooser = new JFileChooser();
	FileNameExtensionFilter filter = new FileNameExtensionFilter(
		"Fichiers XML", "xml");
	chooser.setFileFilter(filter);
	int returnVal = chooser.showSaveDialog(mainPanel);
	if (returnVal == JFileChooser.APPROVE_OPTION) {
	   // mainPanel.getTreePanel().save(chooser.getSelectedFile());
	}
    }

}
